# coding:utf-8

# 公共属性
# stopwords
import jieba


# 停用词
from config import basepath

stopwords = []
userDict = []
def loadStopwords():
    stopwordsPath = basepath + '/sentiment/senti_dict/dict/baidu_stopwords.txt'
    userdictPath = basepath + '/sentiment/senti_dict/dict/userdict.txt'
    # jieba.load_userdict(userdictPath)  # 用户新词
    global stopwords
    global userDict
    with open(stopwordsPath, 'r', encoding='utf-8') as file:
        stopwords = [line.strip() for line in file.readlines()]
    with open(userdictPath, 'r', encoding='utf-8') as file:
        userDict = [line.strip() for line in file.readlines()]

loadStopwords()
